package ${cfg.appService};

import ${package.Entity}.${entity};
import ${package.Service}.${table.serviceName};
import ${cfg.appService}.${cfg.appServiceName};
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang3.StringUtils;
import lombok.extern.slf4j.Slf4j;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * <p>
 * ${table.comment!} dubbo实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
@Slf4j
<#if kotlin>
open class ${cfg.appServiceName}Impl : ${cfg.appServiceName} {

}
<#else>
public class ${cfg.appServiceName}Impl  implements ${cfg.appServiceName} {

    @Autowired
    private ${table.serviceName} ${table.serviceName?uncap_first} ;


    /**
      * 根据id获取数据
      * @param id
      * @return ${entity}
      */
    @Override
    public ${entity} findById(String id){
       if(StringUtils.isEmpty(id)){
            log.warn("根据id获取数据失败!传入参数:[{}]",id);
            return null;
        }
       return ${table.serviceName?uncap_first}.getById(id);
    }

	/**
	 * 分页查询
	 *
	 * @param page
	 * @param query
	 * @return
	 */
	@Override
	public IPage<${entity}> selectPage(Page<${entity}> page, ${entity} query) {
		return ${table.serviceName?uncap_first}.selectPage(page,query);
	}

}
</#if>
